<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../../base.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!--Enum数据字典，动态加载-->
<sys:genericTag4o id="_enumData" methodName="getEnumData"
                  className="com.tmptSource.controller.taglib.A1EnumTag"/>
<sys:genericTag4o id="_enumColumnSelfData" methodName="getEnumColumnSelfData"
                  className="com.tmptSource.controller.taglib.${classNameFirstWordUpper}Tag"/>

<#list columnList as column>
<#if column.dataResource?exists && column.dataResource==2>
<!--页面上查询列的值，动态加载，sql语句读数据库配置而来-->
<sys:genericTag4o id="_selectOptions4${column.propertyName}" methodName="select4${column.propertyName}"
				  className="com.tmptSource.controller.taglib.${classNameFirstWordUpper}Tag"/>
</#if>
</#list>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

<title>Add_Edit</title>

<link href="${r"$"}{path}/admin123/css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${r"$"}{path}/js/jquery/easyui1.5/themes/bootstrap/easyui.css"/>
<link rel="stylesheet" type="text/css" href="${r"$"}{path}/js/jquery/easyui1.5/themes/icon.css"/>
<script type="text/javascript" src="${r"$"}{path}/js/jquery-1.8.0.min.js"></script>
<script src="${r"$"}{path}/js/jquery/easyui1.5/jquery.easyui.min.js"></script>
<script src="${r"$"}{path}/js/jquery/easyui1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${r"$"}{path}/js/jquery.select.js"></script>
<script type="text/javascript" src="${r"$"}{path}/js/myjs/myutils.js?random=<%=Math.random()%>"></script>
<script type="text/javascript" src="data.js?random=<%=Math.random()%>"></script>

<style type="text/css">
	#layoutui { margin:5px;}
	#layoutui ol {  margin: 0;padding:5px;list-style: none;}
	#layoutui ol li{
		margin: 1px; padding-left:5px; padding-top:4px;
		float:left;
		width:300px; height:30px;
		background-color: #efefef;
        border: 1px solid #ddd;
	}
	#layoutui label{width:100px;float:left; border-bottom:0px solid #fff;}
	.clear_div{clear:both;}
</style>
<script type="text/javascript">
	var _path = '${path}';
	var _primaryKey='${primaryKey}';
	var _isdialog4AddDialog = '${templateTable.isdialog4AddDialog}';

	//Add dialog 中combobox 选择时，看看哪些字段不用输入，直接隐藏了
	var _columnCombobox4AddArray = new Array();
	var _columnCombobox4AddJsonArray = new Array();

	//row data
	var _parameter1_iframedialog = ${r"$"}{paramValues.parameter1_iframedialog[0]};
	/*var _parameter2_iframedialog = ${r"$"}{paramValues.parameter2_iframedialog[0]};
	var _parameter3_iframedialog = ${r"$"}{paramValues.parameter3_iframedialog[0]};*/
</script>
<script type="text/javascript" src="../utils/add_edit.js?random=<%=Math.random()%>"></script>

</head>
<body class="font14">

	<form id="form_add" method="post">
		<input type="hidden" id="${primaryKey}" name="${primaryKey}"/>
		<#if templateTable.isdialog4AddDialog!=1>
		<div id="layoutui" style="<#if templateTable.style4AddDialog!=''>${templateTable.style4AddDialog}<#else>width:800px;height:400px</#if>">
		<#else>
        <div id="layoutui">
		</#if>
			<ol>
				<#list columnsTag.column4Add as column>
				<li id="_${column.columnName}_line" class="text"  title="${column.columnTip}"
					<#if column.columnLayoutStyle4adddialog?exists && column.columnLayoutStyle4adddialog!=''>style="${column.columnLayoutStyle4adddialog}"</#if>>
					<#--<script type="text/javascript">
						//所有列备份一下，一会隐藏了，可以恢复
						_columnDivArray[_columnDivArray.length] = '#_${item.columnName}_line';
					</script>-->
					<label >${column.columnShowName}</label>
					<input class="${column.columnType}" name="${column.propertyName}" id="${column.propertyName}4Add"
						<#if column.dataOptions4AddDialog!=''>data-options=${column.dataOptions4AddDialog}<#else>data-options={"valueField":"keyName","textField":"valueName"}</#if>  />
					<#if column.columnType?contains('combobox')>
					<script type="text/javascript">
						<#if column.dataResource?exists && column.dataResource==2>
						//动态通过SQL取值
						_columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${r"$"}{_selectOptions4${column.propertyName}.jsonStr4addDialog}';
                        _columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${column.propertyName}4Add';
						<#elseif column.dataResource?exists && (column.dataResource==1||column.dataResource==4)>
						//动态通过数据字典取值
                        _columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${r"$"}{_enumColumnSelfData.${column.propertyNameFirstWordUpper}4addDialog}';
                        _columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${column.propertyName}4Add';
						<#elseif column.dataResource?exists && column.dataResource==5>
						//动态通过数据字典取值
                        _columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${r"$"}{_enumData.${column.propertyNameFirstWordUpper}4addDialog}';
                        _columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${column.propertyName}4Add';
						<#elseif column.a1TemplateColumnOptionJsonArray?exists && column.a1TemplateColumnOptionJsonArray!=''>
						//静态取值
                        _columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${column.a1TemplateColumnOptionJsonArray}';
                        _columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${column.propertyName}4Add';
						</#if>

					</script>
					</#if>

					<#--<#if item.a1TemplateColumnOptionJsonArray?exists && item.a1TemplateColumnOptionJsonArray!='' && item.columnType=='easyui-combobox'>
					<script type="text/javascript">
						_columnCombobox4AddJsonArray[_columnCombobox4AddJsonArray.length] = '${item.a1TemplateColumnOptionJsonArray}';
						_columnCombobox4AddArray[_columnCombobox4AddArray.length] = '${item.propertyName}4Add';
					</script>
					</#if>-->
				</li>
				</#list>
			</ol>
			<div style="clear:both;"></div>

			<#if templateTable.isdialog4AddDialog!=1>
			<!-- 添加弹出框 Buttons -->
			<div style="background-color: #fff; text-align: center;margin-top:10px;">
				<table cellpadding="0" cellspacing="0" style="width:100%">
					<tr>
						<td style="text-align:center;">
							<a href="#" id="form_addButton" class="easyui-linkbutton" iconCls="icon-save">保存</a>
						</td>
					</tr>
				</table>
			</div>
			</#if>

			<div style="height: 20px;"></div>
		</div>


	</form>

</body>
</html>




